import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import User from '../components/User'
import Welcome from '../components/Welcome'
import Shopping from '../components/Shopping'
import Goods from '../components/display/Goods'
import Address from '../components/display/Address'
import Order from '../components/Order'
import Inventory from '../components/Inventory'
import Jingli from '../components/Jingli'
import MailingInformation from '../components/MailingInformation'
import PrintInvoice from '../components/PrintInvoice'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    {
      path: '/use',
      component: User,
      redirect: '/welcome',
      children: [
        {
          path: '/welcome',
          name: 'wel',
          component: Welcome
        },
        {
          path: '/shopping',
          name: 'shop',
          component: Shopping
        },
        {
          path: '/goods',
          name: 'good',
          component: Goods
        },
        {
          path: '/address',
          name: 'add',
          component: Address
        }
      ]
    },
    {
      path: '/jingo',
      component: Jingli,
      redirect: '/order',
      children: [
        {
          path: '/order',
          name: 'ord',
          component: Order
        },
        {
          path: '/inventory',
          name: 'invent',
          component: Inventory
        },
        {
          path: '/misinformation',
          name: 'info',
          component: MailingInformation
        },
        {
          path: '/printings',
          name: 'print',
          component: PrintInvoice
        }
      ]
    }
  ]
})

export default router
